package com.hqq.service;

import com.hqq.annotation.Aspect;
import com.hqq.annotation.Transaction;
import com.hqq.entity.Customer;
import com.hqq.util.DBUtil;
import org.apache.commons.collections.map.HashedMap;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * CustomerService
 * Created by heqianqian on 2017/7/22.
 */
public class CustomerService {

    /**
     * 获取用户列表
     */
    public List<Customer> getCustomerList() {
        String sql = "SELECT * FROM customer";
        return DBUtil.queryEntityList(Customer.class, sql);
    }

    @Transaction
    public void insertCustomer(Map<String, Object> fieldMap) {
        DBUtil.insertEntity(Customer.class, fieldMap);
    }

}
